repo: Add `query_file` API
authorColin Walters <walters@verbum.org>
Sat, 26 Feb 2022 13:46:50 +0000 (08:46 -0500)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:57 +0000 (12:53 -0400)
commit887f5b09be09cd2b8fa7fc2ef2242ba636039789
tree7e01894c1a0e0bc15569b043d7a3747140c0dcb0
parent1199ae9bbca13b740bfdd7dcad5461f1efdba087
repo: Add `query_file` API

The underlying `ostree_repo_load_file()` API has the caller pass
`NULL` for output arguments it doesn't want.  This isn't sanely
bindable in Rust - what the generator does is always request
all values, but maps them all to `Option<T>`.

The main cases are where a user wants either metadata, or both
metadata and content.  This API gives just metadata; it's a
bit more efficient as we don't need to open the file, and doesn't
require the caller to `unwrap()`.
rust-bindings/rust/src/repo.rs
rust-bindings/rust/tests/repo/mod.rs